package com.hushao.aimi.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @description: 角色信息
 * @author: 胡少
 * @create: 2018-06-03 17:47
 **/
@ApiModel("角色信息")
@Entity
@Data
public class Role implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty("角色名称")
    @Column(length = 32,nullable = false,unique = true)
    private String name;

    @ApiModelProperty("创建时间")
    @CreationTimestamp
    private Timestamp createTime;

    @ApiModelProperty("更新时间")
    @UpdateTimestamp
    private Timestamp updateTime;

    @ApiModelProperty("备注")
    @Column(length = 512)
    private String comment;

    public Role(String name, Timestamp createTime, Timestamp updateTime, String comment) {
        this.name = name;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.comment = comment;
    }
}